package com.prueba.client.interfaz.inicio;


import com.prueba.client.interfaz.antigua.InterfazPrincipal;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;

public class PanelLoginRegistro extends VLayout{
	static public PanelLoginRegistro getInstance(){
		if (singleton==null){
			singleton=new PanelLoginRegistro();
		}
		return singleton;
	}
	static private PanelLoginRegistro singleton=null;
	
	private PanelLoginRegistro(){
		super();		
		IButton botonLogin=new IButton("Login");
		botonLogin.addClickHandler(new ClickHandler() { 
        	@Override
            public void onClick(ClickEvent event) {  
        		PanelInicio.getInstance().removeMember(PanelLoginRegistro.getInstance());
        		PanelInicio.getInstance().addMember(PanelLogout.getInstance());
        		InterfazPrincipal.getInstance().iniciarUsuarioInterfaz();
        	}
		});
		this.addMember(botonLogin);
		this.addMember(new IButton("Registrarse"));
		Img logo=new Img("piramide.jpg",223,226);
		logo.setAlign(Alignment.CENTER);
		logo.setValign(VerticalAlignment.CENTER );
		this.addMember(logo);
	}
}
